﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EventsSample
{
    public class Consumer
    {
        private string name;
        public Consumer(string name1)
        {
            name = name1;
        }

        public void NewCar(object sender, CarInfoEventArgs e) =>//事件订阅
         Console.WriteLine($"{name}: 车 {e.Car} 是新的");
    }
}
